package xio.ccf_201609;

import java.util.Scanner;

/**
 * ccf 201609-1 最大波动 100分
 * Created by Xio on 2017/10/19 0019.
 */
public class MaxFluctuation {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int D = sc.nextInt();
        int flu = -1; //波动
        int price = sc.nextInt(); //第一天的price

        for (int i = 1; i < D; i++) {
            int cur = sc.nextInt();
            int tmp = Math.abs(cur - price);
            price = cur;
            if (tmp > flu){
                flu = tmp;
            }
        }
        System.out.printf(flu+"");
    }
}
